package writtenTraining.day2;

import java.util.*;

/**
 * day2:（1）模拟： BC64 牛牛的快递
 */

public class Main {
    public static void main(String[] args) {
        // 模拟
        // 输入
        Scanner in = new Scanner(System.in);
        double a = in.nextDouble(); char b = in.next().charAt(0);

        int ret = 20;

        if(a > 1) {
            // 如果超过就 + 1
            ret += (a > (int)a ? (int)a  : a - 1);
        }

        if(b == 'y') {
            // 如果需要加急
            ret += 5;
        }

        // 输出
        System.out.println(ret);
    }
}


/**
 * day2:(2)动态规划：最小花费爬楼梯
 */


 class Main1 {
    public static void main(String[] args) {
        // 动态规划

        // 输入
        Scanner in = new Scanner(System.in);
        int len = in.nextInt();
        int[] nums = new int[len];
        for(int i = 0 ; i < len; i++) {
            nums[i] = in.nextInt();
        }

        // 创建dp
        int[] dp = new int[len+1];


        // 填表
        for(int i = 2; i <= len; i++) {
            dp[i] = Math.min(dp[i - 2] + nums[i - 2], dp[i-1] + nums[i-1]);
        }

        System.out.println(dp[len]);

    }
}


/**
 * day2:(3)模拟+ 贪心： 数组中两个字符串的最小距离
 */


 class Main2 {
    public static void main(String[] args) {
        // 输入并且更新
        Scanner in = new Scanner(System.in);
        int len = in.nextInt();
        String str1 = in.next(), str2 = in.next();
        int INF = 0x3f3f3f3f;
        int s1 = INF, s2 = -INF, min = INF;
        for(int i = 0 ; i < len; i++) {
            String str = in.next();
            if(str.equals(str1)) {
                min = Math.min(Math.abs(s1-s2),min);
                s1 = i;
            }else if(str.equals(str2)) {
                min = Math.min(Math.abs(s1-s2),min);
                s2 = i;
            }
        }
        min = Math.min(Math.abs(s1-s2),min);
        // 输出
        System.out.println(min >= 1e5 ? -1 : min);
    }
}